#include "tcp_client.hpp"
#include <memory>

void Usage()
{
    std::cout << "Please enter the correct format: "
              << "./client [server's ip] [server's port]" << std::endl;
}

// ./client [ip] [port] (由用户指定服务端的ip和port)
int main(int argc, char *argv[])
{
    if (argc != 3)
    {
        Usage();
        exit(USAGE_ERR);
    }

    std::string svr_ip = argv[1];
    uint16_t svr_port = atoi(argv[2]);

    std::unique_ptr<TcpClient> tcln(new TcpClient(svr_port, svr_ip));

    tcln->Initial();
    tcln->Start();

    return 0;
}